package calao.client;

import com.google.gwt.user.client.rpc.RemoteService;

public interface WorkspaceService
extends RemoteService 
{

	static Permission ADMIN_WORKSPACES = new Permission("calao.AdminWorkspaces");

	/** Lists all workspaces.
	 * This method returns an array of WorkspaceInfo objects with the following attributes
	 * set: name, id. 
	 * <p>Requires permission {@link #ADMIN_WORKSPACES}.  
	 */
	WorkspaceInfo[] listWorkspaces()
	throws NotConnectedException, MissingPermissionException;
	
	/** Gets details of a workspace.
	 * <p>Requires permission {@link #ADMIN_WORKSPACES}.  
	 */
	WorkspaceInfo detailWorkspace(int wsid)
	throws NotConnectedException, MissingPermissionException;
	
	/** Creates a new workspace.
	 * <p>Requires permission {@link #ADMIN_WORKSPACES}.  
	 */
	WorkspaceInfo createWorkspace(String path)
	throws NotConnectedException, MissingPermissionException;
	
	/** Deletes a workspace.
	 * <p>Requires permission {@link #ADMIN_WORKSPACES}.  
	 */
	void deleteWorkspace(int wsid)
	throws NotConnectedException, MissingPermissionException;

}
